module.exports = {
  server:{
    port: process.env.NODE_ENV === 'production' ? 3011 : 3010,
    host:'0.0.0.0'
  },

  mode: 'universal',
  /*
  ** Headers of the page
  */
  head: {
    title: '云里云外开源社区',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '云里云外开源社区致力于构建国内自主可控的开源生态，通过在青年学子中倡导开源文化，在各种不同应用场景中锤炼开源技术，形成富于中国特色的开源模式、模型和手段，为本土开源企业与开源软件提供分享与交流的平台，促进国产开源软件的繁荣发展。' },
      { hid: 'keywords', name: 'keywords', content: '云里云外开源社区,开源社区,云里云外开源,开源,开源软件,开源网站,开源代码,java开源,perl开源,ruby开源,php开源,开源项目,python开源' },

    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#fff' },
  /*
  ** Global CSS
  */
  css: [
    // '~/assets/gray-filter.css',
    '~/assets/font/iconfont.css',
    '~/assets/reset.scss',
  ],
  pageTransition: {
    name: 'fade',
    mode: 'out-in'
  },
  layoutTransition: {
    name: 'fade-transform',
    mode: 'out-in'
  },
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '~/plugins/axios',
    {src: '~/plugins/baidu.js', ssr: false},
    {src: '~/plugins/highlight.js', ssr: false},
    {src: '~/plugins/websocket.js', ssr: false},
    {src: '~/plugins/notifications.js', ssr: false},
    {src:'~/plugins/mavonEditor.js',ssr:false},
    {src:'~/plugins/cropper.js',ssr:false},
    {src:'~/plugins/globalBux.js',ssr:false},
    {src:'~/plugins/messageBox.js',ssr:true},
    {src:'~/plugins/popupBox.js',ssr:true},
    {src:'~/plugins/message.js',ssr:true},
    {src:'~/plugins/yunIcon.js',ssr:true},
    {src:'~/plugins/yunCropper.js',ssr:false},
    {src:'~/plugins/yunAvatar.js',ssr:true},
    {src:'~/plugins/yunInput.js',ssr:true},
    {src:'~/plugins/yunVideo.js',ssr:false},
    {src:'~/plugins/yunTextarea.js',ssr:false},
    {src:'~/plugins/yunEditor.js',ssr:false},
  ],
  /*
  ** Nuxt.js dev-modules
  */
  buildModules: [
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    '@nuxtjs/axios',
  ],
  /**
   * axios options
   */
  axios: {
    baseURL: process.env.NODE_ENV === 'production' ? 'http://localhost:8080' : 'http://api.opensource.yundingshuyuan.com',
    browserBaseURL: process.env.NODE_ENV === 'production' ? 'https://api.yunliyunwai.cn' : 'http://api.opensource.yundingshuyuan.com'
  },

  router: {
    scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 }
    }
  },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    styleResources: {
      scss: './assets/base.scss'
    },
    extend (config, ctx) {
      config.module.rules.push(
        {
          test: /\.md$/,
          loader: 'raw-loader'
        },
      )
    }
  }
}
